package main

import (
	"fmt"
	"io/ioutil"
	"net"
)

func main() {
	conn, err := net.Dial("tcp", ":20001")
	if err != nil {
		panic(err)
	}

	defer conn.Close()
	_, err = conn.Write([]byte("this is a go client message \n"))
	if err != nil {
		panic(err)
	}
	result, err := ioutil.ReadAll(conn)
	if err != nil {
		panic(err)
	}
	fmt.Println("--- this server resp " + string(result))
}
